コード例 #1
0
 private void CmdDeleteCharacter(SerializedCharacter character, Guid guid)
 {
     DeleteCharacter(character.ToCharacter()).AddBoth((res, p) =>
     {
         SendReturnValue(guid, res);
         return(res);
     });
 }
コード例 #2
0
 protected override bool SendReturnValue(Guid guid, object value)
 {
     if (base.SendReturnValue(guid, value))
     {
         return(true);
     }
     if (value.GetType() == typeof(Character))
     {
         if (IsServer)
         {
             RpcReturnValueCharacter(guid, new SerializedCharacter((Character)value));
         }
         else
         {
             CmdReturnValueCharacter(guid, new SerializedCharacter((Character)value));
         }
         return(true);
     }
     if (value.GetType() == typeof(List <Character>))
     {
         List <Character>      vlist = value as List <Character>;
         SerializedCharacter[] clist = new SerializedCharacter[vlist.Count];
         for (int index = 0; index < vlist.Count; ++index)
         {
             clist[index] = new SerializedCharacter(vlist[index]);
         }
         if (IsServer)
         {
             RpcReturnValueCharacterList(guid, clist);
         }
         else
         {
             CmdReturnValueCharacterList(guid, clist);
         }
         return(true);
     }
     if (value.GetType() == typeof(Account))
     {
         if (IsServer)
         {
             RpcReturnValueAccount(guid, (Account)value);
         }
         else
         {
             CmdReturnValueAccount(guid, (Account)value);
         }
         return(true);
     }
     return(false);
 }
コード例 #3
0
 private void RpcReturnValueCharacter(Guid guid, SerializedCharacter value)
 {
     HandleRemoteCallResult(guid, value.ToCharacter());
 }