File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 3737 <Reference Include =" Assembly-CSharp" >
3838 <HintPath >PELib\Assembly-CSharp.dll</HintPath >
3939 </Reference >
40+ <Reference Include =" Assembly-CSharp-firstpass" >
41+ <HintPath >PELib\Assembly-CSharp-firstpass.dll</HintPath >
42+ </Reference >
4043 <Reference Include =" System" />
4144 <Reference Include =" System.Core" />
4245 <Reference Include =" System.Xml.Linq" />
Original file line number Diff line number Diff line change @@ -68,13 +68,23 @@ public static void LoadMultiplayerData()
6868 var customData = new CustomCharactor . CustomData ( ) ;
6969 customData . Deserialize ( buff ) ;
7070
71+ var steamId = SteamFriendPrcMgr . Instance . GetMyInfo ( ) . _SteamID . m_SteamID ;
72+
73+ var roleId = steamId . GetHashCode ( ) ;
74+
75+ if ( roleId > int . MaxValue - 4 )
76+ {
77+ roleId = 1 ;
78+ }
79+
7180 rez . Add ( new CustomData . RoleInfo ( )
7281 {
7382 appearData = customData . appearData . Serialize ( ) ,
7483 nudeData = customData . nudeAvatarData . Serialize ( ) ,
7584 name = customData . charactorName ,
7685 sex = ( byte ) ( int ) customData . sex ,
77- roleID = rez . Count + 1
86+ steamId = steamId ,
87+ roleID = roleId + rez . Count + 1
7888 } ) ;
7989 }
8090 }
Original file line number Diff line number Diff line change 11using HarmonyLib ;
2+ using System . Linq ;
23
34namespace PEPatch
45{
@@ -20,12 +21,24 @@ public static bool CreatePlayer(UIPlayerBuildCtrl __instance)
2021 var playerModel = Traverse . Create ( __instance ) . Field ( "mCurrent" ) . GetValue < PlayerModel > ( ) ;
2122 byte [ ] appearData = playerModel . mAppearData . Serialize ( ) ;
2223 byte [ ] nudeData = playerModel . mNude . Serialize ( ) ;
24+
25+ var steamId = SteamFriendPrcMgr . Instance . GetMyInfo ( ) . _SteamID . m_SteamID ;
26+
27+ var roleId = steamId . GetHashCode ( ) ;
28+
29+ if ( roleId > int . MaxValue - 4 )
30+ {
31+ roleId = 1 ;
32+ }
33+
2334 var role = new CustomData . RoleInfo ( )
2435 {
2536 appearData = appearData ,
2637 nudeData = nudeData ,
2738 name = name ,
28- sex = ( byte ) ( int ) Traverse . Create ( __instance ) . Property ( "Sex" ) . GetValue ( )
39+ sex = ( byte ) ( int ) Traverse . Create ( __instance ) . Property ( "Sex" ) . GetValue ( ) ,
40+ steamId = SteamFriendPrcMgr . Instance . GetMyInfo ( ) . _SteamID . m_SteamID ,
41+ roleID = roleId + GameClientLobby . Self . myRoles . Where ( r => r . deletedFlag != 1 ) . Select ( r => r . roleID ) . DefaultIfEmpty ( 0 ) . Max ( ) + 1
2942 } ;
3043
3144 GameClientLobby . Self . myRoles . Add ( role ) ;
You can’t perform that action at this time.
0 commit comments