Exemplo n.º 1
0
 public static BigInteger NumUserSiegeHistory(User user)
 {
     return(Op.Bytes2BigInt(
                IO.GetStorageWithKeyPath(
                    Const.preUser, user.email,
                    Const.keyTotSiege
                    )
                ));
 }
Exemplo n.º 2
0
 public static byte[] FindDataCity(BigInteger serverId, BigInteger cityId)
 {
     return(IO.GetStorageWithKeyPath(
                Const.preServer,
                Op.BigInt2String(serverId),
                Const.preCity,
                Op.BigInt2String(cityId)
                ));
 }
Exemplo n.º 3
0
 public static byte[] FindDataSiege(BigInteger serverId, byte[] seigeId)
 {
     return(IO.GetStorageWithKeyPath(
                Const.preServer,
                Op.BigInt2String(serverId),
                Const.preSeige,
                Op.Bytes2String(seigeId)
                ));
 }
Exemplo n.º 4
0
 public static byte SaveCity(BigInteger serverID, City city)
 {
     return(IO.SetStorageWithKeyPath(City2Bytes(city)
                                     , Const.preServer
                                     , Op.BigInt2String(serverID)
                                     , Const.preCity
                                     , Op.BigInt2String(city.cityId)
                                     ));
 }
Exemplo n.º 5
0
 public static BigInteger NumCitySiegeHistory(BigInteger serverId, BigInteger cityId)
 {
     return(Op.Bytes2BigInt(
                IO.GetStorageWithKeyPath(
                    Const.preServer, Op.BigInt2String(serverId),
                    Const.preCity, Op.BigInt2String(cityId),
                    Const.keyTotSiege
                    )
                ));
 }
Exemplo n.º 6
0
 public static byte SaveSiege(Siege siege)
 {
     byte[] data = Seige2Bytes(siege);
     return(IO.SetStorageWithKeyPath(data,
                                     Const.preServer,
                                     Op.BigInt2String(siege.serverID),
                                     Const.preCity,
                                     Op.BigInt2String(siege.cityID)
                                     ));
 }
Exemplo n.º 7
0
        public static byte[] FindSiegeDataByCityHistId(BigInteger serverId, BigInteger cityId, BigInteger histId)
        {
            byte[] siegeId = IO.GetStorageWithKeyPath(
                Const.preServer, Op.BigInt2String(serverId),
                Const.preCity, Op.BigInt2String(cityId),
                Const.preSeige, Op.BigInt2String(histId)
                );

            return(FindDataSiege(serverId, siegeId));
        }
Exemplo n.º 8
0
        public static BigInteger AddSiegeCityHist(BigInteger serverId, BigInteger cityId, byte[] siegeId)
        {
            BigInteger histId = NumCitySiegeHistory(serverId, cityId);

            IO.SetStorageWithKeyPath(siegeId,
                                     Const.preServer, Op.BigInt2String(serverId),
                                     Const.preCity, Op.BigInt2String(cityId),
                                     Const.preSeige, Op.BigInt2String(histId)
                                     );

            IO.SetStorageWithKeyPath(Op.BigInt2Bytes(histId + 1),
                                     Const.preServer, Op.BigInt2String(serverId),
                                     Const.preCity, Op.BigInt2String(cityId),
                                     Const.keyTotSiege
                                     );
            return(histId);
        }
Exemplo n.º 9
0
 public static byte[] ReadWeathers()
 {
     return(IO.GetStorageWithKey(Const.preWeather));
 }
Exemplo n.º 10
0
 public static byte SaveWeathers(byte[] weathers)
 {
     return(IO.SetStorageWithKey(Const.preWeather, weathers));
 }
Exemplo n.º 11
0
 public static byte[] FindDataUser(string email)
 {
     return(IO.GetStorageWithKeyPath(Const.preUser, email));
 }
Exemplo n.º 12
0
 public static byte SaveUser(User user)
 {
     return(IO.SetStorageWithKeyPath(User2Bytes(user), Const.preUser, user.email));
 }
Exemplo n.º 13
0
 public static byte[] FindDataCard(byte[] cardID)
 {
     return(IO.GetStorageWithKeyPath(Const.preCard, Op.Bytes2String(cardID)));
 }
Exemplo n.º 14
0
 public static byte SaveCard(Card card)
 {
     return(IO.SetStorageWithKeyPath(Card2Bytes(card), Const.preCard, Op.Bytes2String(card.cardID)));
 }