mirror of
https://github.com/CPunch/gopenfusion.git
synced 2025-11-06 23:50:20 +00:00
major refactoring; started DB
- DB work has started in db. this will be a direct port of the OpenFusion DB format. - LoginServer is now less of a dummy. You can create and login to accounts, and create a character to go through the tutorial with. - config.go will host some commonly changed variables. - protocol: fixed a bug relating to arrays being ignored while encoding packets
This commit is contained in:
@@ -125,12 +125,12 @@ func (pkt *Packet) Encode(data interface{}) {
|
||||
for i := 0; i < sz; i++ {
|
||||
pkt.encodeStructField(rv.Type().Field(i), rv.Field(i))
|
||||
}
|
||||
case reflect.Slice: // (untested)
|
||||
case reflect.Array:
|
||||
sz := rv.Len()
|
||||
|
||||
// encode data
|
||||
for i := 0; i < sz; i++ {
|
||||
elem := rv.Index(i).Addr()
|
||||
elem := rv.Index(i)
|
||||
pkt.Encode(elem.Addr().Interface())
|
||||
}
|
||||
case reflect.Uint8:
|
||||
@@ -215,7 +215,7 @@ func (pkt *Packet) Decode(data interface{}) {
|
||||
for i := 0; i < sz; i++ {
|
||||
pkt.decodeStructField(rv.Type().Field(i), rv.Field(i))
|
||||
}
|
||||
case reflect.Array: // (untested)
|
||||
case reflect.Array:
|
||||
sz := rv.Len()
|
||||
|
||||
// decode data
|
||||
|
||||
Reference in New Issue
Block a user