generateSteamGameServer method

Future<void> generateSteamGameServer({
  1. required String path,
  2. required IOSink exportSink,
  3. Set<String> enumSet = const {},
  4. Set<String> structSet = const {},
  5. Set<String> callbackStructSet = const {},
})

Generates code for steam game server

Implementation

Future<void> generateSteamGameServer({
  required String path,
  required IOSink exportSink,
  Set<String> enumSet = const {},
  Set<String> structSet = const {},
  Set<String> callbackStructSet = const {},
}) async {
  SteamInitializer gameServer = SteamInitializer(
    name: "SteamGameServer",
    methods: [
      SteamMethod(
        name: "Init",
        nameFlat: "SteamGameServer_Init",
        returnType: "bool",
        params: [
          SteamParam(
            name: "unIP",
            type: "uint32",
          ),
          SteamParam(
            name: "usSteamPort",
            type: "uint16",
          ),
          SteamParam(
            name: "usGamePort",
            type: "uint16",
          ),
          SteamParam(
            name: "usQueryPort",
            type: "uint16",
          ),
          SteamParam(
            name: "eServerMode",
            type: "EServerMode",
          ),
          SteamParam(
            name: "pchVersionString",
            type: "const char *",
          ),
        ],
      ),
      SteamMethod(
        name: "ReleaseCurrentThreadMemory",
        nameFlat: "SteamGameServer_ReleaseCurrentThreadMemory",
        returnType: "void",
      ),
      // SteamMethod(
      //   name: "RunCallbacks",
      //   nameFlat: "SteamGameServer_RunCallbacks",
      //   returnType: "void",
      // ),
      SteamMethod(
        name: "Shutdown",
        nameFlat: "SteamGameServer_Shutdown",
        returnType: "void",
      ),
      SteamMethod(
        name: "GetHSteamPipe",
        nameFlat: "SteamGameServer_GetHSteamPipe",
        returnType: "HSteamPipe",
      ),
      SteamMethod(
        name: "GetHSteamUser",
        nameFlat: "SteamGameServer_GetHSteamUser",
        returnType: "HSteamUser",
      ),
    ],
  );

  await gameServer.generateFile(
    path: path,
    exportSink: exportSink,
    enumSet: enumSet,
    structSet: structSet,
    callbackStructSet: callbackStructSet,
  );
}