Skip to content

Darkgrouptw/SmartFoxServer-BinaryReader-In-Golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartFoxServer Binary Data Reader

Outline

  1. Introduction
  2. Details
  3. Something Interesting

Introduction

This project is based on SmartFoxServer, and it transfor the binary data to map in Golang.

In my working project(not this one), our game server(Java) need to store some game data in database by storing into a class and celling this. Our operation server(Golang) which shows statistics data and collect Flurry data and to decode the binary data. The offical website is not provide Golang API and therefore I made up this project. The following picture shows the situation.

Workflow

Details

The testdata in the main file is a binary data and transfor to hex string. SFSReader is a class which may implement the SFSObject in java.

SFSReader:

  • DecodeDataToMap: Decode the binary data to map data. It's similar to newFromBinaryData
  • SFSGetArray: Get sfs array from DataWrapper(SFSPbject).
  • SFSGetIntArray: Get int array from DataWrapper(SFSPbject).
  • SFSGetInt: Get int from DataWrapper(SFSObject)

Something Interesting

I use ILSpy to decompile C# Smartfoxserver (Plz don't sue me), and I may give some suggestions to this API.

  • Compress the data if you have an array that store class multi-times.
  • PutByte and PutBool stores same size(1 byte) in SmartFoxServer. PutByte PutBool
  • Maximum size of byte array is 2^32. Maximum size of other array is 2^16 ByteArray IntArray
  • The red part in the below figure is not being implement yet. MissingPart

About

2020.11.16 Reading SmartFoxServer Data In Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages