Changes in binary-improvements [213:211]
- Location:
- binary-improvements
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/7dtd-server-fixes.csproj
r213 r211 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> 50 53 <Reference Include="EasyAntiCheat.Client"> 51 54 <HintPath>..\7dtd-binaries\EasyAntiCheat.Client.dll</HintPath> … … 59 62 <Reference Include="LogLibrary"> 60 63 <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
r213 r211 20 20 public static string GetPlayerName (ClientInfo _ci) 21 21 { 22 return _ci.playerName; 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; 23 29 } 24 30 25 31 public static EntityPlayer GetEntityPlayer (ClientInfo _ci) 26 32 { 27 return GetGameManager ().World.playerEntities.dict [_ci.entityId]; 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; 28 40 } 29 41 30 42 public static string GetSteamID (ClientInfo _ci) 31 43 { 32 return _ci.playerId; 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); 33 50 } 34 51 35 52 public static int GetClientID (ClientInfo _ci) 36 53 { 37 return _ci.clientId; 54 if (_ci != null) { 55 if (GetConnectionManager ().connectedClients.ContainsKey (_ci.clientId)) 56 return _ci.clientId; 57 } 58 return -1; 38 59 } 39 60 40 61 public static int GetEntityID (ClientInfo _ci) 41 62 { 42 return _ci.entityId; 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; 43 74 } 44 75 … … 48 79 ConnectionManager cm = GetConnectionManager (); 49 80 50 return cm.GetClientInfoForEntityId (_entityId); 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; 51 90 } catch (Exception e) { 52 91 Log.Out ("Error getting ClientInfo for entity ID: " + e); … … 118 157 public static ClientInfo GetClientInfoFromSteamID (string _steamId) 119 158 { 120 return GetConnectionManager ().GetClientInfoForPlayerId (_steamId); 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; 121 170 } 122 171 -
binary-improvements/7dtd-server-fixes/src/NetConnections/ConsoleOutputSeparator.cs
r213 r211 24 24 private static IConnection issuerOfCurrentCommand; 25 25 26 public static void C_ExecuteCmdFromClient (ConsoleSdtd console, NetworkPlayer _networkPlayer, string _player Name, string _playerID, string _command)26 public static void C_ExecuteCmdFromClient (ConsoleSdtd console, NetworkPlayer _networkPlayer, string _playerID, string _command) 27 27 { 28 Log.Out ("Executed command \"" + _command + "\" from player \"" + _player Name+ "\"");28 Log.Out ("Executed command \"" + _command + "\" from player \"" + _playerID + "\""); 29 29 30 30 lock (netCommandQueue) { 31 31 isCurrentCommandFromClient = true; 32 32 console.issuerOfCurrentClientCommand = _networkPlayer; 33 console.ExecuteClientCmdInternal (_player Name, _playerID, _command);33 console.ExecuteClientCmdInternal (_playerID, _command); 34 34 isCurrentCommandFromClient = false; 35 35 } -
binary-improvements/assembly-patcher/Main.cs
r213 r211 41 41 { 42 42 TypeDefinition type = module.GetType ("ConsoleSdtd"); 43 replaceMethod (type, "ExecuteCmdFromClient", true, 4, typeof(AllocsFixes.NetConnections.ConsoleOutputSeparator).GetMethod ("C_ExecuteCmdFromClient"));43 replaceMethod (type, "ExecuteCmdFromClient", true, 3, 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
r213 r211 1 Version: 0.103.54 61.32941 Version: 0.103.5459.40864 -
binary-improvements/server-fixes.userprefs
r213 r211 1 1 <Properties> 2 2 <MonoDevelop.Ide.Workspace ActiveConfiguration="Release_Version" /> 3 <MonoDevelop.Ide.Workbench ActiveDocument="7dtd-server-fixes/src/C ommonMappingFunctions.cs">3 <MonoDevelop.Ide.Workbench ActiveDocument="7dtd-server-fixes/src/CustomCommands/TeleportPlayer.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=" 163" Column="47" />14 <File FileName="7dtd-server-fixes/src/CommonMappingFunctions.cs" Line="88" Column="5" /> 15 15 <File FileName="7dtd-server-fixes/src/AllocsLogFunctions.cs" Line="24" Column="33" /> 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" /> 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" /> 19 18 </Files> 20 19 <Pads>
Note:
See TracChangeset
for help on using the changeset viewer.