matching server event protocol - SG-Finder/auth_server GitHub Wiki

matching-server-protocol

Server On Event

event-name : connection

  • required data : x

event-name : ack

  • required data :
{
    "session_token" : "ajcihgasij913=",
    "userId" : "gksxodnd007"
}

event-name : ready

  • required data : x

event-name : disconnect

  • required data : x

event-name : gameStart

  • required data : x

event-name : sendMessage

  • required data :
{
    "from": "gksxodnd007",
    "message": "안녕 나는 코딩하는 오징어야"
}

Server Emit Event

event-name : authorized

  • send data :
  • success인 경우
{
    "permit" : "true",
    "afterEvent" : "none"
}
  • fail인 경우
{
    "permit" : "false",
    "afterEvent" : "disconnect"
}

event-name : getData

  • send data :
  • success인 경우
{
    "dataAccess" : "true",
    "afterEvent" : "ready"
}
  • fail인 경우
{
    "dataAccess" : "false",
    "afterEvent" : "disconnect"
}

event-name : entry

  • send data :
{
    "entryUser" : "gksxodnd1",
    "entryUserScore" : 152,
    "entryUserTier" : "BRONZE"
}

event-name : leave

  • send data :
{
    "leaveUser": "gksxodnd1"
    "leaveUserScore" : 152,
    "leaveUserTier" : "BRONZE"
}

event-name : matchingResult

  • send data :
{
    "playersId" : [ "gksxodnd007", "gksxodnd3" ],
    "roomId" : "dkasjohf-39"
}   

event-name : receiveMessage

  • send data :
{
    "from": "gksxodnd007",
    "message": "안녕 나는 코딩하는 오징어야"
}

event-name : disconnect

  • send data : x