Added Godot based server

This commit is contained in:
2024-01-20 22:18:58 +01:00
parent ce699ee6db
commit 1f73d22cd6
28 changed files with 338 additions and 135 deletions

20
tools/server/login.go Normal file
View File

@ -0,0 +1,20 @@
package main
import (
"bytes"
"fmt"
"server/core"
"server/packet"
)
// login checks the account credentials and gives a network peer access to an account.
func login(data []byte, client *core.Client) {
if !bytes.Equal(data, []byte("password")) {
fmt.Println("login failure")
server.Send(packet.LOGIN, []byte{1}, client)
return
}
fmt.Println("login success")
server.Send(packet.LOGIN, []byte{0}, client)
}