Changes in binary-improvements [211:213]
- Location:
- binary-improvements
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/7dtd-server-fixes.csproj
r211 r213 48 48 <HintPath>..\7dtd-binaries\UnityEngine.dll</HintPath> 49 49 </Reference> 50 <Reference Include="Assembly-CSharp">51 <HintPath>..\7dtd-binaries\Assembly-CSharp.dll</HintPath>52 </Reference>53 50 <Reference Include="EasyAntiCheat.Client"> 54 51 <HintPath>..\7dtd-binaries\EasyAntiCheat.Client.dll</HintPath> … … 62 59 <Reference Include="LogLibrary"> 63 60 <HintPath>..\7dtd-binaries\LogLibrary.dll</HintPath> 61 </Reference> 62 <Reference Include="Assembly-CSharp"> 63 <HintPath>..\7dtd-binaries\Assembly-CSharp.dll</HintPath> 64 64 </Reference> 65 65 </ItemGroup> -
binary-improvements/7dtd-server-fixes/src/CommonMappingFunctions.cs
r211 r213 20 20 public static string GetPlayerName (ClientInfo _ci) 21 21 { 22 try { 23 int entityId = GetConnectionManager ().mapClientToEntity [_ci.clientId]; 24 return GetGameManager ().World.playerEntities.dict [entityId].EntityName; 25 } catch (Exception e) { 26 Log.Out ("Error getting player name for ClientInfo: " + e); 27 } 28 return null; 22 return _ci.playerName; 29 23 } 30 24 31 25 public static EntityPlayer GetEntityPlayer (ClientInfo _ci) 32 26 { 33 try { 34 int entityId = GetConnectionManager ().mapClientToEntity [_ci.clientId]; 35 return GetGameManager ().World.playerEntities.dict [entityId]; 36 } catch (Exception e) { 37 Log.Out ("Error getting entity player for ClientInfo: " + e); 38 } 39 return null; 27 return GetGameManager ().World.playerEntities.dict [_ci.entityId]; 40 28 } 41 29 42 30 public static string GetSteamID (ClientInfo _ci) 43 31 { 44 return Steam.Authentication.Server.GetPlayerId (GetPlayerName (_ci)); 45 } 46 47 public static string GetSteamID (string _playerName) 48 { 49 return Steam.Authentication.Server.GetPlayerId (_playerName); 32 return _ci.playerId; 50 33 } 51 34 52 35 public static int GetClientID (ClientInfo _ci) 53 36 { 54 if (_ci != null) { 55 if (GetConnectionManager ().connectedClients.ContainsKey (_ci.clientId)) 56 return _ci.clientId; 57 } 58 return -1; 37 return _ci.clientId; 59 38 } 60 39 61 40 public static int GetEntityID (ClientInfo _ci) 62 41 { 63 try { 64 ConnectionManager cm = GetConnectionManager (); 65 66 if (cm.mapClientToEntity.ContainsKey (_ci.clientId)) 67 return cm.mapClientToEntity [_ci.clientId]; 68 else 69 return -1; 70 } catch (Exception e) { 71 Log.Out ("Error getting entity ID for ClientInfo: " + e); 72 } 73 return -1; 42 return _ci.entityId; 74 43 } 75 44 … … 79 48 ConnectionManager cm = GetConnectionManager (); 80 49 81 if (cm.mapClientToEntity.ContainsValue (_entityId)) { 82 foreach (KeyValuePair<int, int> kvp in cm.mapClientToEntity) { 83 if (kvp.Value == _entityId) { 84 return cm.connectedClients [kvp.Key]; 85 } 86 } 87 } 88 89 return null; 50 return cm.GetClientInfoForEntityId (_entityId); 90 51 } catch (Exception e) { 91 52 Log.Out ("Error getting ClientInfo for entity ID: " + e); … … 157 118 public static ClientInfo GetClientInfoFromSteamID (string _steamId) 158 119 { 159 try { 160 foreach (string name in Steam.Authentication.Server.usersToIDs.Keys) { 161 string curId = string.Empty + Steam.Authentication.Server.usersToIDs[name].steamID.m_SteamID; 162 if (curId.Equals (_steamId)) { 163 return GetClientInfoFromPlayerName (name, false); 164 } 165 } 166 } catch (Exception e) { 167 Log.Out ("Error getting ClientInfo for steam ID: " + e); 168 } 169 return null; 120 return GetConnectionManager ().GetClientInfoForPlayerId (_steamId); 170 121 } 171 122 -
binary-improvements/7dtd-server-fixes/src/NetConnections/ConsoleOutputSeparator.cs
r211 r213 24 24 private static IConnection issuerOfCurrentCommand; 25 25 26 public static void C_ExecuteCmdFromClient (ConsoleSdtd console, NetworkPlayer _networkPlayer, string _player ID, string _command)26 public static void C_ExecuteCmdFromClient (ConsoleSdtd console, NetworkPlayer _networkPlayer, string _playerName, string _playerID, string _command) 27 27 { 28 Log.Out ("Executed command \"" + _command + "\" from player \"" + _player ID+ "\"");28 Log.Out ("Executed command \"" + _command + "\" from player \"" + _playerName + "\""); 29 29 30 30 lock (netCommandQueue) { 31 31 isCurrentCommandFromClient = true; 32 32 console.issuerOfCurrentClientCommand = _networkPlayer; 33 console.ExecuteClientCmdInternal (_player ID, _command);33 console.ExecuteClientCmdInternal (_playerName, _playerID, _command); 34 34 isCurrentCommandFromClient = false; 35 35 } -
binary-improvements/assembly-patcher/Main.cs
r211 r213 41 41 { 42 42 TypeDefinition type = module.GetType ("ConsoleSdtd"); 43 replaceMethod (type, "ExecuteCmdFromClient", true, 3, typeof(AllocsFixes.NetConnections.ConsoleOutputSeparator).GetMethod ("C_ExecuteCmdFromClient"));43 replaceMethod (type, "ExecuteCmdFromClient", true, 4, typeof(AllocsFixes.NetConnections.ConsoleOutputSeparator).GetMethod ("C_ExecuteCmdFromClient")); 44 44 addHook (type, "Run", true, 0, true, typeof(AllocsFixes.NetConnections.ConsoleOutputSeparator).GetMethod ("C_Run")); 45 45 replaceMethod (type, "SendResult", true, 1, typeof(AllocsFixes.NetConnections.ConsoleOutputSeparator).GetMethod ("C_SendResult")); -
binary-improvements/bin/Release/7dtd-server-fixes_version.txt
r211 r213 1 Version: 0.103.54 59.408641 Version: 0.103.5461.3294 -
binary-improvements/server-fixes.userprefs
r211 r213 1 1 <Properties> 2 2 <MonoDevelop.Ide.Workspace ActiveConfiguration="Release_Version" /> 3 <MonoDevelop.Ide.Workbench ActiveDocument="7dtd-server-fixes/src/C ustomCommands/TeleportPlayer.cs">3 <MonoDevelop.Ide.Workbench ActiveDocument="7dtd-server-fixes/src/CommonMappingFunctions.cs"> 4 4 <Files> 5 5 <File FileName="7dtd-server-fixes/src/PersistentData/Players.cs" Line="40" Column="70" /> … … 12 12 <File FileName="7dtd-server-fixes/src/CustomCommands/webstat.cs" Line="6" Column="22" /> 13 13 <File FileName="7dtd-server-fixes/src/CustomCommands/ListLandProtection.cs" Line="70" Column="44" /> 14 <File FileName="7dtd-server-fixes/src/CommonMappingFunctions.cs" Line=" 88" Column="5" />14 <File FileName="7dtd-server-fixes/src/CommonMappingFunctions.cs" Line="163" Column="47" /> 15 15 <File FileName="7dtd-server-fixes/src/AllocsLogFunctions.cs" Line="24" Column="33" /> 16 <File FileName="7dtd-server-fixes/src/CustomCommands/ListPlayersExtended.cs" Line="46" Column="5" /> 17 <File FileName="7dtd-server-fixes/src/CustomCommands/TeleportPlayer.cs" Line="21" Column="1" /> 16 <File FileName="7dtd-server-fixes/src/CustomCommands/ListPlayerIds.cs" Line="47" Column="1" /> 17 <File FileName="7dtd-server-fixes/src/CustomCommands/TeleportPlayer.cs" Line="20" Column="27" /> 18 <File FileName="7dtd-server-fixes/src/AssemblyInfo.cs" Line="20" Column="34" /> 18 19 </Files> 19 20 <Pads>
Note:
See TracChangeset
for help on using the changeset viewer.