public static MarketUsersReply LogEventToMarketUsersReply(LogEventResponse eventResponse) { MarketUsersReply reply = new MarketUsersReply(true); List <object> users = eventResponse.ScriptData.GetObjectList("marketUsers"); foreach (Dictionary <string, object> user in users) { MarketUsersReply.User marketUser = new MarketUsersReply.User(); marketUser.id = user["_id"].ToString(); marketUser.name = user["name"].ToString(); marketUser.gender = ((Dictionary <string, object>)user["profile"])["gender"].ToString(); long birthdate = long.Parse(((Dictionary <string, object>)user["profile"])["birthdate"].ToString()); marketUser.birthdate = new DateTime(1970, 1, 1) + new TimeSpan(birthdate * 10000); marketUser.price = long.Parse(((Dictionary <string, object>)user["stats"])["price"].ToString()); marketUser.online = user["online"].ToString() != "0"; marketUser.recentlyJoined = user["recentlyJoined"].ToString() != "0"; reply.Users.Add(marketUser); } return(reply); }
void MarketUsersCallback(MarketUsersReply reply) { if (reply.Success) { foreach (MarketUsersReply.User user in reply.Users) { Debug.Log("Market User Profile: " + user.name + "-" + user.gender + "-" + user.online + "-" + user.recentlyJoined + "-" + user.id + "-" + user.price); } TestServerTime(); } else { Debug.Log("Fetching user market users failed"); } }