public PlayfeedWriter.ErrorCode Publishfeed(uint logType, uint userNo, uint feedCategory, uint feedTypeNo, string gamefeed, out string token) { token = string.Empty; PlayfeedWriter.ErrorCode result; if (gamefeed.Length > 2048) { Logger.Warn("Playfeed size is too big, this data will be discarded."); result = PlayfeedWriter.ErrorCode.kError_FeedSizeOver; } else { string item = FeedatomJsonSerializer.ToPlayfeedJson(this._serviceCode, feedTypeNo, logType, feedCategory, userNo, gamefeed); if (!this.EnqueueItem(item)) { result = PlayfeedWriter.ErrorCode.kError_SendBufferFull; } else { result = PlayfeedWriter.ErrorCode.kError_None; } } return(result); }
public static string ToPlayfeedJson(string serviceCode, uint feedTypeNo, uint logType, uint feedCategory, uint userNo, string gamefeed) { object[] objArray = new object[] { "{\"serviceCode\":\"", serviceCode, "\",\"feedTypeNo\":", feedTypeNo, ",\"type\":", logType, ",\"category\":", feedCategory, ",\"userNo\":", userNo, ",\"gameLog\":\"", FeedatomJsonSerializer.EscapeString(gamefeed).ToString(), "\"}" }; return(string.Concat(objArray)); }