|
||
|
|||||||
| Network Modifications This forum is for modifications to the networking code of RunUO |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
Join Date: Mar 2003
Location: England
Age: 35
Posts: 986
|
Ive been trying for the last 2 hours to change the supported features within the core dependant on the client expansion.. The problem i face is that the Network.Flags are not set until the player logs in with a character, so i cannot seem to test if the player uses Mondains Legacy etc at server login...
i have Highlighted in bold where the Netstate flags are set. PacketHandlers.cs Code:
public static void PlayCharacter( NetState state, PacketReader pvSrc )
{
pvSrc.ReadInt32(); // 0xEDEDEDED
string name = pvSrc.ReadString( 30 );
pvSrc.Seek( 2, SeekOrigin.Current );
int flags = pvSrc.ReadInt32();
pvSrc.Seek( 24, SeekOrigin.Current );
int charSlot = pvSrc.ReadInt32();
int clientIP = pvSrc.ReadInt32();
IAccount a = state.Account;
if ( a == null || charSlot < 0 || charSlot >= a.Length )
{
state.Dispose();
}
else
{
Mobile m = a[charSlot];
// Check if anyone is using this account
for ( int i = 0; i < a.Length; ++i )
{
Mobile check = a[i];
if ( check != null && check.Map != Map.Internal && check != m )
{
Console.WriteLine( "Login: {0}: Account in use", state );
state.Send( new PopupMessage( PMMessage.CharInWorld ) );
return;
}
}
if ( m == null )
{
state.Dispose();
}
else
{
if ( m.NetState != null )
m.NetState.Dispose();
NetState.ProcessDisposedQueue();
state.BlockAllPackets = true;
state.Flags = flags;
and this is where i need them.. PacketHandlers.cs Code:
public static void GameLogin( NetState state, PacketReader pvSrc )
{
if ( state.SentFirstPacket )
{
state.Dispose();
return;
}
state.SentFirstPacket = true;
int authID = pvSrc.ReadInt32();
if ( !IsValidAuthID( authID ) )
{
Console.WriteLine( "Login: {0}: Invalid client detected, disconnecting", state );
state.Dispose();
return;
}
else if ( state.m_AuthID != 0 && authID != state.m_AuthID )
{
Console.WriteLine( "Login: {0}: Invalid client detected, disconnecting", state );
state.Dispose();
return;
}
else if ( state.m_AuthID == 0 && authID != state.m_Seed )
{
Console.WriteLine( "Login: {0}: Invalid client detected, disconnecting", state );
state.Dispose();
return;
}
string username = pvSrc.ReadString( 30 );
string password = pvSrc.ReadString( 30 );
int flags = pvSrc.ReadInt32();
GameLoginEventArgs e = new GameLoginEventArgs( state, username, password );
EventSink.InvokeGameLogin( e );
if ( e.Accepted )
{
state.CityInfo = e.CityInfo;
state.CompressionEnabled = true;
if ( Core.AOS )
state.Send( SupportedFeatures.Instantiate( state.Account, flags ) );
state.Send( new CharacterList( state.Account, state.CityInfo ) );
}
else
{
state.Dispose();
}
}
Since Ea/Osi use this ability, there must be some packet info i could use to set the Netstate.Flags earlier. Or, another way to detect the expansion type from ClientVersion info? Thanks for reading jay |
|
|
|
|
|
#2 (permalink) | |
|
Forum Expert
Join Date: Mar 2003
Location: England
Age: 35
Posts: 986
|
Quote:
Yes and no, the accounts are tagged with what version you are permitted to use, but if you dont update your client, you cannot create an elf for example. |
|
|
|
|
|
|
#4 (permalink) |
|
Forum Expert
Join Date: Mar 2003
Location: England
Age: 35
Posts: 986
|
After some experiments, they arent the same packet info, gamelogin packet contains only authID and user name and pass strings, i could find no such info in this packet pertaining to client expansion type, or any other client info at all for that matter.
![]() |
|
|
|
|
|
#5 (permalink) | |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
|
Quote:
http://kec.cz/tartaros/steamengine/u...tml?style=gold |
|
|
|
|
|
|
#6 (permalink) | |
|
Forum Expert
Join Date: Mar 2003
Location: England
Age: 35
Posts: 986
|
Quote:
Ah, i may be to blame there, my apologies, i added the overload flags to that line myself as i was experimenting with something. Base runuo is just,, Code:
if ( Core.AOS ) state.Send( SupportedFeatures.Instantiate( state.Account ) ); |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|