Handler3.cs @ worldThank you for that the zone now works...but i'm getting
Code:[29/01/2016 04:23:32] (Warn) Invalid client authentication from 192.168.0.3
Any assistance would be appreciated.
[29/01/2016 14:58:55] (Warn) Invalid client authentication from 77.98.*.*
using System;
using Zepheus.FiestaLib;
using Zepheus.FiestaLib.Networking;
using Zepheus.Util;
using Zepheus.World.Data;
using Zepheus.World.Networking;
namespace Zepheus.World.Handlers
{
public sealed class Handler3
{
[PacketHandler(CH3Type.WorldClientKey)]
public static void TransferKey(WorldClient client, Packet packet)
{
string key;
if (!packet.ReadSkip(18) || !packet.TryReadString(out key, 32))
{
Log.WriteLine(LogLevel.Warn, "Invalid connection request.");
client.Disconnect();
return;
}
ClientTransfer transfer = ClientManager.Instance.GetTransfer(key);
if (transfer != null)
{
// Check if client does not connect from localhost or LAN,
// and if it's connecting from the correct IP.
// When this check is not done, people can remote hack someone.
if (!client.Host.StartsWith("127.0") && !client.Host.StartsWith("192.") && transfer.HostIP != client.Host)
{
Log.WriteLine(LogLevel.Warn, "Remotehack from {0}", client.Host);
SendError(client, ServerError.InvalidCredentials);
}
else
{
if (ClientManager.Instance.RemoveTransfer(transfer.Hash) && (!Program.Maintenance || transfer.Admin > 0)) //admins can still login
{
client.Authenticated = true;
client.AccountID = transfer.AccountID;
client.Admin = transfer.Admin;
client.Username = transfer.Username;
client.lastPing = DateTime.Now; //this is so pongthread can start checking him
client.Pong = true;
client.RandomID = MathUtils.RandomizeUShort(ushort.MaxValue);
Log.WriteLine(LogLevel.Debug, "{0} authenticated.", client.Username);
SendCharacterList(client);
}
}
}
else
{
Log.WriteLine(LogLevel.Warn, "Invalid client authentication from {0}", client.Host);
SendError(client, ServerError.InvalidCredentials);
}
}
[PacketHandler(CH3Type.BackToCharSelect)]
public static void BackToCharSelect(WorldClient pClient, Packet pPacket)
{
bool go; // dunno
if (!pPacket.TryReadBool(out go))
{
Log.WriteLine(LogLevel.Warn, "Couldn't read back to char select packet");
return;
}
if (!pClient.Authenticated)
{
Log.WriteLine(LogLevel.Warn, "Player tried using the back to char select packet while not able to");
return;
}
if (go)
{
SendCharacterList(pClient);
}
}
public static void SendError(WorldClient client, ServerError error)
{
using (Packet pack = new Packet(SH3Type.Error))
{
pack.WriteShort((byte)error);
client.SendPacket(pack);
}
}
private static void SendCharacterList(WorldClient client)
{
if (!client.LoadCharacters())
{
SendError(client, ServerError.DatabaseError);
return;
}
using (var packet = new Packet(SH3Type.CharacterList))
{
packet.WriteUShort(client.RandomID);
packet.WriteByte((byte)client.Characters.Count);
foreach (WorldCharacter ch in client.Characters.Values)
{
PacketHelper.WriteBasicCharInfo(ch, packet);
}
client.SendPacket(packet);
}
}
}
}
Log.WriteLine(LogLevel.Warn, "Invalid client authentication from {0}", client.Host);
SendError(client, ServerError.InvalidCredentials);
client.Authenticated = true;
client.AccountID = transfer.AccountID;
client.Admin = transfer.Admin;
client.Username = transfer.Username;
client.lastPing = DateTime.Now; //this is so pongthread can start checking him
client.Pong = true;
client.RandomID = MathUtils.RandomizeUShort(ushort.MaxValue);
Log.WriteLine(LogLevel.Debug, "{0} authenticated.", client.Username);
SendCharacterList(client);
What is a packet? :^)I really suggest you learn to use the tools and do a little research on this before you venture into making or working on an existing emulator.
But FiestaShark shows you the incoming, outgoing game packets.
The game sends a packet to the server, the server finds a handler for it, it writes that handler into a packet of its own, and it sends it back to the server.
i think of it like this. The server is a giant library of game handlers, the client goes to this library and requests a book (handler) the server finds that book and it gives it to the client.
on FiestaShark it will help you identity the packets
Outgoing packets are packets the client sends to the server.
incoming packets are packets coming back from the server.
the header and types can also be identified through FiestaShark, and your emulator's types must match the types of whichever client you're using.
So yah they lived happily ever after yada yada.
pls don't ask what a packet is, I'll literally die
Hi,
The client opcode which is sent to the server is not supported. To resolve this issue open Zepheus.FiestaLib PacketTypeClient.cs
Change the Login to 5, if this doesn't work send me a PM.
public enum CH3Type : byte
{
Version = 101,
Login = 90,
WorldReRequest = 27,
FileHash = 4,
WorldSelect = 11,
//Actually used in World
WorldClientKey = 15,
BackToCharSelect = 24,
}
public enum CH3Type : byte
{
Version = 101,
Login = 5,
WorldReRequest = 27,
FileHash = 4,
WorldSelect = 11,
//Actually used in World
WorldClientKey = 15,
BackToCharSelect = 24,
}
6/04/01 12:42:39] (Info) 60 Handlers loaded.[2016/04/01 12:42:39] (Info) 13 InterHandlers loaded.
[2016/04/01 12:42:39] (Info) Loaded 97 maps!
[2016/04/01 12:42:39] (Info) Loaded 1221 bad names.
[2016/04/01 12:42:39] (Info) Load 1 MasterRewards
[2016/04/01 12:42:39] (Info) DataProvider initialized successfully!
[2016/04/01 12:42:39] (Info) Connected to server @ localhost:10022
[2016/04/01 12:42:39] (Info) IV data received
[2016/04/01 12:42:39] (Info) Listening on port 11000 for zones.
[2016/04/01 12:42:39] (Info) <3 LoginServer.
[2016/04/01 12:42:40] (Info) ClientManager initialized.
[2016/04/01 12:42:40] (Info) Load 1 AcademyLevelUpPoints
[2016/04/01 12:42:40] (Warn) 1750 has duplicate equip in slot 12
[2016/04/01 12:42:40] (Warn) 57363 has duplicate equip in slot 12
[2016/04/01 12:42:40] (Warn) 57363 has duplicate equip in slot 12
[2016/04/01 12:42:40] (Warn) 57363 has duplicate equip in slot 12
[2016/04/01 12:42:40] (Warn) 57363 has duplicate equip in slot 12
[2016/04/01 12:42:40] (Warn) 57363 has duplicate equip in slot 12
[2016/04/01 12:42:40] (Warn) 1750 has duplicate equip in slot 12
[2016/04/01 12:42:40] (Warn) 750 has duplicate equip in slot 12
[2016/04/01 12:42:40] (Exception) Fatal exception while load: System.ArgumentException: 列 'IsChatBlocked' はテーブル に属していません。
場所 System.Data.DataRow.GetDataColumn(String columnName)
場所 System.Data.DataRow.get_Item(String columnName)
場所 Zepheus.World.Data.Guilds.Academy.GuildAcademyMember.Load(DataRow Row) 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\Guild\Academy\GuildAcademyMember.cs:行 50
場所 Zepheus.World.Data.Guilds.Academy.GuildAcademyMember..ctor(GuildAcademy Academy, WorldCharacter Character, DataRow Row) 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\Guild\Academy\GuildAcademyMember.cs:行 30
場所 Zepheus.World.Data.Guilds.Academy.GuildAcademy.Load() 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\Guild\Academy\GuildAcademy.cs:行 83
場所 Zepheus.World.Data.Guilds.Academy.GuildAcademy..ctor(Guild Guild) 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\Guild\Academy\GuildAcademy.cs:行 43
場所 Zepheus.World.Data.Guilds.Guild.Load() 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\Guild\Guild.cs:行 162
場所 Zepheus.World.Data.Guilds.Guild..ctor(MySqlConnection con, MySqlDataReader reader) 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\Guild\Guild.cs:行 104
場所 Zepheus.World.Data.GuildDataProvider.LoadGuilds() 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\GuildDataProvider.cs:行 41
場所 Zepheus.World.Data.GuildDataProvider..ctor() 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\GuildDataProvider.cs:行 29
場所 Zepheus.World.Data.GuildDataProvider.Init() 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\GuildDataProvider.cs:行 22
場所 Zepheus.World.Program.<Load>b__a(Func`1 method) 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Program.cs:行 157
場所 System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
場所 Zepheus.World.Program.Load() 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Program.cs:行 157: 場所 System.Data.DataRow.GetDataColumn(String columnName)
場所 System.Data.DataRow.get_Item(String columnName)
場所 Zepheus.World.Data.Guilds.Academy.GuildAcademyMember.Load(DataRow Row) 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\Guild\Academy\GuildAcademyMember.cs:行 50
場所 Zepheus.World.Data.Guilds.Academy.GuildAcademyMember..ctor(GuildAcademy Academy, WorldCharacter Character, DataRow Row) 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\Guild\Academy\GuildAcademyMember.cs:行 30
場所 Zepheus.World.Data.Guilds.Academy.GuildAcademy.Load() 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\Guild\Academy\GuildAcademy.cs:行 83
場所 Zepheus.World.Data.Guilds.Academy.GuildAcademy..ctor(Guild Guild) 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\Guild\Academy\GuildAcademy.cs:行 43
場所 Zepheus.World.Data.Guilds.Guild.Load() 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\Guild\Guild.cs:行 162
場所 Zepheus.World.Data.Guilds.Guild..ctor(MySqlConnection con, MySqlDataReader reader) 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\Guild\Guild.cs:行 104
場所 Zepheus.World.Data.GuildDataProvider.LoadGuilds() 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\GuildDataProvider.cs:行 41
場所 Zepheus.World.Data.GuildDataProvider..ctor() 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\GuildDataProvider.cs:行 29
場所 Zepheus.World.Data.GuildDataProvider.Init() 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Data\GuildDataProvider.cs:行 22
場所 Zepheus.World.Program.<Load>b__a(Func`1 method) 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Program.cs:行 157
場所 System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
場所 Zepheus.World.Program.Load() 場所 c:\Users\pandora\Desktop\Estrella-master\Zepheus.World\Program.cs:行 157
[2016/04/01 12:42:40] (Error) Errors occured starting server. Press RETURN to exit.
I think he meant to type 56, since that is the actual one and not 5.Code:public enum CH3Type : byte { Version = 101, Login = 90, WorldReRequest = 27, FileHash = 4, WorldSelect = 11, //Actually used in World WorldClientKey = 15, BackToCharSelect = 24, }
Change that to:
?? Did i understand correctly?Code:public enum CH3Type : byte { Version = 101, Login = 5, WorldReRequest = 27, FileHash = 4, WorldSelect = 11, //Actually used in World WorldClientKey = 15, BackToCharSelect = 24, }