private static void OnSwitchCharacterModel(MySyncCharacter sync, ref SwitchCharacterModelMsg msg, MyNetworkClient sender) { if (sync.ResponsibleForUpdate(sender)) { var handler = sync.CharacterModelSwitched; if (handler != null) { handler(msg.Model, msg.ColorMaskHSV); } } }
public void ChangeCharacterModelAndColor(string model, Vector3 colorMaskHSV) { if (ResponsibleForUpdate(this)) { var msg = new SwitchCharacterModelMsg(); msg.CharacterEntityId = Entity.EntityId; msg.Model = model; msg.ColorMaskHSV = colorMaskHSV; Sync.Layer.SendMessageToAllAndSelf(ref msg); } }
private static void OnSwitchCharacterModel(MySyncCharacter sync, ref SwitchCharacterModelMsg msg, MyNetworkClient sender) { if (Sync.IsServer && sync.ResponsibleForUpdate(sender)) { var handler = sync.CharacterModelSwitched; if (handler != null) { handler(msg.Model, msg.ColorMaskHSV); } Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId); } else if (sender.SteamUserId == Sync.ServerId || sender.SteamUserId == Sync.MyId) { var handler = sync.CharacterModelSwitched; if (handler != null) { handler(msg.Model, msg.ColorMaskHSV); } } }
private static void OnSwitchCharacterModel(MySyncCharacter sync, ref SwitchCharacterModelMsg msg, MyNetworkClient sender) { if (Sync.IsServer && sync.ResponsibleForUpdate(sender)) { var handler = sync.CharacterModelSwitched; if (handler != null) { handler(msg.Model, msg.ColorMaskHSV); } Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId); } else if (sender.SteamUserId == Sync.ServerId || sender.SteamUserId == Sync.MyId) { var handler = sync.CharacterModelSwitched; if (handler != null) handler(msg.Model, msg.ColorMaskHSV); } }
public void ChangeCharacterModelAndColor(string model, Vector3 colorMaskHSV) { if (ResponsibleForUpdate(this)) { var msg = new SwitchCharacterModelMsg(); msg.CharacterEntityId = Entity.EntityId; msg.Model = model; msg.ColorMaskHSV = colorMaskHSV; Sync.Layer.SendMessageToServerAndSelf(ref msg); } }
private static void OnSwitchCharacterModel(MySyncCharacter sync, ref SwitchCharacterModelMsg msg, MyNetworkClient sender) { if (sync.ResponsibleForUpdate(sender)) { var handler = sync.CharacterModelSwitched; if (handler != null) handler(msg.Model, msg.ColorMaskHSV); } }